package dockyin.action.pattern.iterator;

import java.util.Vector;

public class MyCollection implements Collection {

    private Vector<Object> buffer = new Vector<>();

    @Override
    public Iterator iterator() {
        return new MyIterator(this);
    }

    @Override
    public void add(Object o) {
        buffer.add(o);
    }

    @Override
    public Object get(int i) {
        return buffer.get(i);
    }

    @Override
    public int size() {
        return buffer.size();
    }
}
